package com.shg.bean;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import org.compass.annotations.Index;
import org.compass.annotations.Searchable;
import org.compass.annotations.SearchableComponent;
import org.compass.annotations.SearchableProperty;
import org.compass.annotations.Store;

@Searchable(root=false)
public class Shop implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	//店铺的ID号
	@SearchableProperty(index=Index.NO,store=Store.YES)
	private String id;
	//店铺的名称
	@SearchableProperty(index=Index.NO,store=Store.YES)
	private String shopName;
	//公司名称
	//店铺Logo
	private String logo;
	//公司名称
	private String coName;
	//店铺的开发状态0、关闭 1、开放
	private Integer state=1;
	//公司地址
	private String coAddress;
	//简介
	private String synopsis;
	//店铺的注册日期
	private Date registerDate=new Date();
	//店铺知名度
	private Integer love;
	//开户人，一个店铺值对于一个开户人
	private Users users;
	//书籍 一个店铺可以有很多的书籍
	private Set<Book> book;
	//店铺的服务员
	@SearchableComponent
	private Set<Online> childs;
	//存储在线用户的集合，该集合不会映射到数据库
	private Set<Online> onlines=new HashSet<Online>();
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getShopName() {
		return shopName;
	}

	public void setShopName(String shopName) {
		this.shopName = shopName;
	}

	public String getLogo() {
		return logo;
	}

	public void setLogo(String logo) {
		this.logo = logo;
	}

	public String getCoName() {
		return coName;
	}

	public void setCoName(String coName) {
		this.coName = coName;
	}

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public String getCoAddress() {
		return coAddress;
	}

	public void setCoAddress(String coAddress) {
		this.coAddress = coAddress;
	}

	public String getSynopsis() {
		return synopsis;
	}

	public void setSynopsis(String synopsis) {
		this.synopsis = synopsis;
	}

	public Integer getLove() {
		return love;
	}

	public void setLove(Integer love) {
		this.love = love;
	}

	public Date getRegisterDate() {
		return registerDate;
	}

	public void setRegisterDate(Date registerDate) {
		this.registerDate = registerDate;
	}

	public Set<Book> getBook() {
		return book;
	}

	public void setBook(Set<Book> book) {
		this.book = book;
	}

	public Users getUsers() {
		return users;
	}

	public void setUsers(Users users) {
		this.users = users;
	}
	
	public Set<Online> getChilds() {
		return childs;
	}

	public void setChilds(Set<Online> childs) {
		this.childs = childs;
	}

	public Set<Online> getOnlines() {
		return onlines;
	}

	public void setOnlines(Set<Online> onlines) {
		this.onlines = onlines;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Shop other = (Shop) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}
	
	
}
